//
//  AFNHttpTools.h
//  DDViedo
//
//  Created by 赵 冰冰 on 15/3/11.
//  Copyright (c) 2015年 赵 冰冰. All rights reserved.
//
typedef void (^RequestSuccessed) (NSDictionary * dict);

typedef void (^RequestFailed) (NSError * err);

#import <Foundation/Foundation.h>
#import "AFNetworking.h"

@interface AFNHttpTools : NSObject

//带token
+(void)requestWithUrl:(NSString *)url andPostDict:(NSDictionary *)postDict andAuthToken:(NSString*)andAuthToken successed:(RequestSuccessed)successed failed:(RequestFailed)failed;

+(void)requestWithUrlAndSignature:(NSString *)url andPostDict:(NSDictionary *)postDict andAuthToken:(NSString*)andAuthToken successed:(RequestSuccessed)successed failed:(RequestFailed)failed;

//获取历史聊天记录
+(void)asyncGetHistoryMessageListWithUrlAndSignature:(NSString *)url andPostDict:(NSDictionary *)postDict andAuthToken:(NSString*)andAuthToken successed:(RequestSuccessed)successed failed:(RequestFailed)failed;


+(void)requestWithFormAndSignature:(NSString *)url andPostDict:(NSDictionary *)postDict andAuthToken:(NSString *)andAuthToken successed:(RequestSuccessed)successed failed:(RequestFailed)failed;

+(void)getDataNoTokenAndSingature:(NSString *)url andParameters:(id)parameters  successed:(RequestSuccessed)successed failed:(RequestFailed)failed;

+(void)asyncConvertAmrToText:(NSString *)localPath successed:(RequestSuccessed)successed failed:(RequestFailed)failed;


+ (void)getDataNoTokenWithUrl:(NSString *)url
                andParameters:(id)parameters
                    successed:(RequestSuccessed)successed
                       failed:(RequestFailed)failed;
///获取AppStore应用信息get方法
+ (void)getAppStoreInfoDataWithUrl:(NSString *)url
                     andParameters:(id)parameters
                         successed:(RequestSuccessed)successed
                            failed:(RequestFailed)failed;

///下载文件
+(void)requestVoiceFile:(NSString *)fileUrl to:(NSString *)localPath successBlock:(RequestSuccessed)successBlock errorBlock:(RequestFailed)errorBlock;


+ (void)getDataWithUrl:(NSString *)url andParameters:(id)parameters successed:(RequestSuccessed)successed failed:(RequestFailed)failed;

// 有签名 无登录 json传参
+(void)requestWithUrlAndSignatureNoToken:(NSString *)url andPostDic:(NSDictionary *)postDict successed:(RequestSuccessed)successed failed:(RequestFailed)failed;

// 
+(void)downloadFile:(NSString *)fileUrl to:(NSString *)localPath successBlock:(RequestSuccessed)successBlock errorBlock:(RequestFailed)errorBlock;


@end
